<?php
include_once('../lib/Sqlexecutor.php');
include_once('../lib/Series.php');
include_once('../lib/HomePage.php');
include('log4php/Logger.php');

$dbh = new Sqlexecutor('localhost', 'tile', 'tile', 'tile');
Logger::configure('config.ini');
$logger = Logger::getLogger('intf');
$s = new Series($dbh, $logger);
$list = $s->getList();
$h = new HomePage($dbh, $logger);
$info = $h->getInfo();

if($list !== false && $info !== false )
{
    $res['series'] = $list;
    $res['homepage'] = $info;
    $res['errno'] = 0;
}
else
{
    $res['errno'] = -100;
}
$output = json_encode($res);
$logger->trace('res: ' . $output);

echo $output;
